//
//  NSTimer+Addition.m
//  轮播图
//
//  Created by dllo on 15/7/1.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "NSTimer+Addition.h"

@implementation NSTimer (Addition)

//暂停
-(void)pauseTimer
{
    //isValid 是否正在运行
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate distantFuture]];
}

//继续
-(void)resumeTimer
{
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate date]];
}

- (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval
{
    if (![self isValid]) {
        return ;
    }
    //– setFireDate: //重新设置定时器开始运行的时间
    [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
}

@end
